    % section 6.4.1 'robustness' / CRRA 
        % this file shows the differences in CE for GHHW and GLTHI 
        % using CRRA utility
    
    clear;
    load('./results/allstates_main.mat');
    load('./results/model_parameters_main.mat');
    addpath functions;
   
    rho = model_parameters.rho;
    MU = model_parameters.MU;
    CAPH = model_parameters.CAPH;
    iX = simulation_output.iX;
    Nstates = 7;
    Ppaid_N = simulation_output.Ppaid_N;
    Wio_abi = simulation_output.Wio_abi;
    Wio_rea = simulation_output.Wio_rea;

    maxreps = 100;
    tolFP=0.005;
    T = 70;
    sigma = 4;
    
    floor= 10;
    [CE_PHI_abi, share_floor_abi_phi] = Welfare_4_crra(Wio_abi,Ppaid_N,0,sigma,iX,rho,Nstates,floor);
    [CE_HHW_abi, share_floor_abi_hhw] = CE_HHW_crra(Wio_abi,iX,MU,CAPH,Nstates,rho,T,tolFP,maxreps,sigma,floor);

    [CE_PHI_rea, share_floor_rea_phi] = Welfare_4_crra(Wio_rea,Ppaid_N,0,sigma,iX,rho,Nstates,floor);
    [CE_HHW_rea, share_floor_rea_hhw] = CE_HHW_crra(Wio_rea,iX,MU,CAPH,Nstates,rho,T,tolFP,maxreps,sigma,floor);
    
    table_CRRA = array2table([CE_HHW_rea CE_PHI_rea; 
                 CE_HHW_abi CE_PHI_abi]);
    table_CRRA = renamevars(table_CRRA,["Var1","Var2"],...
                        ["CE_GHHW","CE_GLTHI"]);

    table_CRRA.metric2 = (table_CRRA.CE_GHHW-table_CRRA.CE_GLTHI)./(table_CRRA.CE_GHHW);

    writetable(table_CRRA,'./results/table_CRRA.xlsx')
    display(["welfare differences between GLTHI and GHWW using CRRA are",num2str(table_CRRA.metric2(1)),"for Ed 10"])
    display(["welfare differences between GLTHI and GHWW using CRRA are",num2str(table_CRRA.metric2(2)),"for Ed 13"])
